<?php
	$title_meta = '评分实时情况';
	include ("header.php");
?>
<body >
	<h1>评分实时情况</h1>
	<div id='app'>
		<p>最佳作品</p>
		<template v-for='vo in top3'>
			<div>{{vo.name}}</div>
			<ul>
				<li v-for='ao in vo.rank'>
					<span>标题：{{ao.post_title}}</span>
					<span>分数{{ao.sum_score}}</span>
				</li>
			</ul>
		</template>
		
    	<p>团队排名</p>
		<ul>
			<li v-for='vo in team_rank'>
				{{vo.name}}:{{vo.sum_score}}
			</li>
		</ul>	
	</div>
	
	
</body>
</html>
<script>



new Vue({
    el: '#app',
    data: {
    	team_rank : {},
    	top3 : {},
    },
    created:function(){
        var _self = this;
        $.ajax({
            type: 'GET',
            url: './app/index.php?m=index&a=topThree',
            success:function(data) {
                _self.top3 = data;
				
            }
        });
        $.ajax({
            type: 'GET',
            url: './app/index.php?m=index&a=teamRank',
            success:function(data) {
                _self.team_rank = data;
				
            }
        });
        },
}) 
</script>
